package com.java.al.type;

import java.util.ArrayList;
import java.util.List;

import com.java.al.foriterator.Person;



public class JavaType
{
	
	public static <T> void first(T one)
	{
		if("class java.util.ArrayList".equals( one.getClass().toString() ) )
		{
			List list = new ArrayList();
			list = (List) one;
			for (int i = 0; i < list.size(); i++)
			{
				System.out.println( list.get(i)+" 是字符串吗："+"".equals( list.get(i) ) );
			}
		}
		else{
			Person person = new Person();
			person = (Person) one;
			System.out.println( "名字："+person.getName() );
			System.out.println( "年龄："+person.getAge() );
		}
	}
	
	public static void main(String[] args)
	{
		Person person = new Person();
		List l = new ArrayList();
		
		l.add(1024);
		l.add("什么类型都加");
		first( l );

		person.setName("张三");
		person.setAge(11);
		first(person);
	}
}
